<%@ page pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><fmt:message key="noteTemplateList.title"/></title>

<script src="<c:url value='/scripts/common.js'/>"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link rel="stylesheet" type="text/css" media="all"	href="<c:url value='/styles/css.css'/>" />
</head>

<body>
<html:form action="noteTemplate">

<table width="99%" border="0" cellspacing="0" cellpadding="0" align=center>

  <tr>
    <td align="left" valign="top">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
             <tr>
                  <td height="31" class="titlebgcolor">
                      <table width="189" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                 <td width="11">&nbsp;</td>
                                 <td width="26"><img src="images/passenger.gif" width="21" height="22" /></td>
                                 <td width="152"><fmt:message key="noteTemplateList.heading"/></td>
                            </tr>



                    </table>
               </td>
            </tr>
       </table>
     </td>
  </tr>
  <tr>
      <td>
          <table>
                  <tr>
                       <td align="left" class="font-search">&nbsp;<fmt:message key="noteTemplateForm.name"/><html:text property="name" />  </td>
                       <td align="left" class="font-search">&nbsp;<fmt:message key="noteTemplateForm.content"/><html:text property="content" /><input type="hidden" name="flag" value="true"></td>
                       <td width="152"><html:submit value="查询"/></td>
                 </tr>      
          </table>
      </td>
  </tr>

  <tr>
    <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="30" align="right" background="images/list_title_bg.jpg">
	    <table width="100%" height="18" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="10" align="left" valign="bottom" class="black12">&nbsp;</td>
                 <td  valign="bottom" class="black12">
                     <input type="button" value="选择" onclick="choseMessage();">
          		</td>
			<td><sasis:page items="${noteTemplateList}"/></td>
              </tr>
            </table></td>
            <td width="6" align="right" valign="top"><img src="images/list_title_right.jpg" width="6" height="30" /></td>
          </tr>
        </table></td>
     </tr>
      <tr>
        <td align="left" valign="top">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width1="98%" align="left" valign="top" class="list_area_bg">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="1%" align="left" valign="top">&nbsp;</td>
                <td width="99%" align="left" valign="top"> 
                <table width="100%" border="1" cellpadding="0" cellspacing="0" class="list_bordercolor"> 
                    <tr>
                    <!--  <td class="list_title_bottom">--> 
                       <td class="list_font_title"><input type="checkbox" name="checkbox" value="checkbox" onclick='checkAll(this.checked,"checkbox2");' /></td>
                      	<td class="list_font_title">&nbsp;<fmt:message key="noteTemplateForm.id"/></td>
                      <td class="list_font_title">&nbsp;<fmt:message key="noteTemplateForm.name"/></td>
                       <td class="list_font_title">&nbsp;<fmt:message key="noteTemplateForm.content"/></td>
	   				 
                    </tr>
		<c:forEach var="results" items="${noteTemplateList}" varStatus="status">
                    <tr>
                      <td><span class="list_title_bottom">
                        <input type="checkbox" name="checkbox2" value="<c:out value='${results.content}'/>" />
                      </span></td>
                      <td class="list_font_area">&nbsp;<c:out value="${results.id}"/></td>
                      <td class="list_font_area">&nbsp;<c:out value="${results.name}"/></td>
                      <td class="list_font_area">&nbsp;<c:out value="${results.content}"/></td>
                      
       
                    </tr>
		</c:forEach> 
                </table>
                </td>
              </tr>
            </table>
            </td>
            <td width="8" align="left" valign="top" background="images/list_area_right.jpg">&nbsp;</td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="4" align="left" valign="top"><img src="images/list_bottom_left.jpg" width="4" height="8" /></td>
            <td align="left" valign="top"><img src="images/list_bottom_middle.jpg" width="100%" height="8" /></td>
            <td width="6" align="right" valign="top"><img src="images/list_bottom_right.jpg" width="6" height="8" /></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<input type="hidden" name="ary"/>
</html:form>
</body>
<script>
//written by kellen 07-04-19
function doMultiSelect(chkName){
		var selected = new Array(); 
		var val = "";	  
		   for (var i=0;i < document.forms[0].elements.length; i++){
				var e = document.forms[0].elements[i]; 
				if (e.name==chkName){
					var chk = document.forms[0].elements[i];
					if(chk.checked){
						var bb = e.value; 
					    	selected.push(bb);
					} 
				}	 
			}	

 		if(0!=selected){
 			if(confirm("<fmt:message key="common.confirm.message"/>")){ 
	 			document.forms[0].ary.value=selected;  
				document.forms[0].method="post";
				document.forms[0].action="./noteTemplate.html?method=delete";
				document.forms[0].submit();
			}else return;	  			
		}else{
			alert("<fmt:message key="common.delete.message"/>");
		}	 
	}
</script>
<script>
function choseMessage()
{
    var arr = new Array();
    var chk = document.forms[0].checkbox2;
    var tempmessage="";
   
    if(chk.length>0)
    {
        for(var i=0;i<chk.length;i++)
        {
               if(chk[i].checked)
               {
               arr.push(chk[i].value);
               }
               
        }
        
        window.opener.document.getElementById("noticeContent").value = arr;
       if(arr=="")
       {
       alert("请选择消息!!!!!");
       return false;
       }
       else
        window.close();
    }
   
   
}
</script>
</html>